<?php

    // 通过$_GET方式接收前端传来的数据
    $name = $_GET['username'] ;
    $pwd = $_GET['password'] ;

    if($name && $pwd) {
        $res = [] ;
        $res['status'] = true ;
        $res['msg'] = '接受到了前端数据';
        echo(json_encode($res));
    } else {
        $res = [] ;
        $res['status'] = false ;
        $res['msg'] = '前端数据有误';
        echo(json_encode($res));
    }